package com.sensePlusVR.testActivity;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

import com.sensePlusVR.main.R;
import com.sensePlusVR.utils.JumpGameTest;
import com.sensePlusVR.utils.MyLog;

public class SencondTestActivity extends Activity{
	
	private static String KEY = "key";

	private Button mButton;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		
 
		
		setContentView(R.layout.main_test);
		
		String btnText = null;
		
		if(savedInstanceState!=null){
			
			btnText = savedInstanceState.getString(KEY);
		}
		
		if(btnText==null){
			
			btnText="Second";
		}
		
		
		MyLog.e("ABC", "SencondTestActivity created");
		
		mButton = (Button) findViewById(R.id.jumpBtn);
		
		mButton.setText(btnText);
		
		mButton.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				
				mButton.setText("second jump");
				
				JumpGameTest.jumpVRActivity(SencondTestActivity.this, true);
				
				
			}
		});
	}
	

	@Override
	protected void onDestroy() {
		// TODO Auto-generated method stub
		super.onDestroy();
		
		MyLog.e("ABC", "SencondTestActivity onDestroy!");
	}

	@Override
	protected void onSaveInstanceState(Bundle outState) {
		
		outState.putString(KEY, "SecondButton 3333");
		
		Log.e("ABC", "MainTestActivity onSaveInstanceState");
		
		super.onSaveInstanceState(outState);
		

	}
	
	@Override
	public void onWindowFocusChanged(boolean hasFocus) {
		// TODO Auto-generated method stub
		super.onWindowFocusChanged(hasFocus);
		if(hasFocus){
			
			getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
					|View.SYSTEM_UI_FLAG_HIDE_NAVIGATION|View.SYSTEM_UI_FLAG_IMMERSIVE);
		}

	}

}
